package com.ocom.ugcapi.client;

import com.alibaba.fastjson.JSONObject;
import com.ocom.common.constant.PayConfigUrl;
import com.ocom.common.entity.card.*;
import com.ocom.common.entity.master.EntityWechatAppInfo;
import com.ocom.common.entity.payconfig.*;
import com.ocom.common.request.callpackage.*;
import com.ocom.common.request.payconfig.*;
import com.ocom.common.request.payconfig.adreceiptinfo.GetAdReceiptInfoRequest;
import com.ocom.common.request.payconfig.mealorder.*;
import com.ocom.common.request.payconfig.repairpay.GetRepairPayRecordListRequest;
import com.ocom.common.request.ugcapi.OrderedShowRequest;
import com.ocom.common.request.ugcapi.order.LoadRestaurantsRequest;
import com.ocom.common.request.web.ConsTimeConfigOnShowRequest;
import com.ocom.common.request.web.ConsumeLimitConfigOnShowRequest;
import com.ocom.common.resp.Result;
import com.ocom.common.vo.PageListResult;
import com.ocom.common.vo.payconfig.*;
import com.ocom.common.vo.payconfig.cloudcomputing.CloudComputingVo;
import com.ocom.common.vo.payconfig.kitchenprinter.PlanKitchenPrinterRequest;
import com.ocom.common.vo.payconfig.schoolphone.SchoolPhoneInfoVo;
import com.ocom.common.vo.payconfig.schoolwifiinfo.SchoolWifiInfoVo;
import com.ocom.common.vo.webapi.PageVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;


@FeignClient(value = "payconfig")
public interface PayConfigClientService {

//    @PostMapping(PayConfigUrl.URLP_PayConfig_MerchPageOne)
//    Result MerchPageOne(@RequestParam("companyId")Long companyId,@RequestParam("parentMerchId")Long parentMerchId,@RequestParam("merchId")Long merchId);

    @PostMapping(PayConfigUrl.Url_restaurantList)
    public Result restaurantList(@RequestBody LoadRestaurantsRequest request);

    @PostMapping(PayConfigUrl.URLP_PayConfig_MerchPageInfo)
    public Result MerchPageInfo(@RequestParam("companyId")Long companyId,@RequestParam("merchId") Integer merchId);

    @PostMapping(PayConfigUrl.URLP_getWxInfo)
    public Result<EntityWechatAppInfo> getWxInfo(@RequestParam("comId") Long comId , @RequestParam("merchId")  Long merchId);


    @PostMapping(PayConfigUrl.Url_getSignList)
    public Result<List<EntityXfChannelInfo>> signList(@RequestParam("comId") Long comId, @RequestParam("payWay")Integer payWay);

    //生成签约申请单
    @PostMapping(PayConfigUrl.Url_addPaySign)
    public Result addPaySign(@RequestBody EntityXfSignOrder entityXfSignOrder);

    //签约回调
    @PostMapping(PayConfigUrl.Url_updatePaySign)
    public Result updatePaySign(@RequestBody EntityXfSignOrder entityXfSignOrder);

    //获取一跳代扣信息
    @PostMapping(PayConfigUrl.Url_getPaySign)
    public Result<EntityXfSignOrder> getPaySign(@RequestParam("outOrderNo") String outOrderNo);


    //获取一跳代扣信息
    @PostMapping(PayConfigUrl.Url_getUserSign)
    public Result getUserSign(@RequestParam("comId")Long comId, @RequestParam("pId")Long pId);

    @PostMapping(PayConfigUrl.Url_getUserPayWay)
    public Result getUserPayWay(@RequestParam("comId")Long comId,@RequestParam("pId") Long pId,
                                @RequestParam("merchId") Integer merchId ,
                                @RequestParam("payWay")Integer payWay);

    @PostMapping(PayConfigUrl.Url_getPayInfo)
    public Result getPayInfo(@RequestBody EntityXfMerchPayInfo entityXfMerchPayInfo);


    /**
     * 设置白名单
     * */
    @PostMapping(PayConfigUrl.Url_SetXFWhiteInfo)
    public Result setXFWhiteInfo(@RequestParam("comId")Long comId,@RequestParam("pId")Long pId,@RequestParam("state")Long state);


    /**
     * 公众号权限
     * @param companyId
     * @return
     */
    @PostMapping(PayConfigUrl.Url_getAppConfig)
    public Result getConfig(@RequestParam("companyId")Long companyId);

    //初始化账号(addXFAccount)
    @PostMapping(PayConfigUrl.Url_AddXFAccount)
    public Result AddXFAccount(@RequestBody EntityXfAccountInfo entityXfAccountIn);

    @PostMapping(PayConfigUrl.Url_getRechargePayWay)
    public Result  getRechargePayWay(@RequestParam("companyId")Long companyId,@RequestParam("merchId") Long merchId
            ,@RequestParam("type") Integer type);


    @PostMapping(PayConfigUrl.Url_getRechargeRule)
    public Result getRechargeRule(@RequestParam("companyId")Long companyId,@RequestParam("subAccount") Integer subAccount);

    @PostMapping(PayConfigUrl.Url_getAdReceiptInfo)
    public Result getAdReceiptInfo(@RequestBody GetAdReceiptInfoRequest request) ;

    /**
     * 11.4.2商户、消费点列表（getMerchPointList）
     */
    @PostMapping(PayConfigUrl.Url_getMerchPointList)
    public Result getMerchPointList(@RequestBody GetMerchPointListRequest request) ;


    @PostMapping(PayConfigUrl.Url_getOrderPlanDishes)
    public Result getOrderPlanDishes(@RequestBody GetOrderPlanDishesRequest request) ;


    //菜品列表（getDishesList）
    @PostMapping(PayConfigUrl.Url_getDishesList)
    public Result getDishesList(@RequestBody JSONObject jsonObject);


    /**
     * 11.4.3已点餐查询（getOrderDishes）
     */
    @PostMapping(PayConfigUrl.Url_getOrderDishes)
    public Result getOrderDishes(@RequestBody GetOrderDishesRequest request) ;

    // 获取单位餐段列表
    @PostMapping(PayConfigUrl.URLP_PayConfig_getCompanyMealNo)
    public Result getCompanyMealNo(@RequestParam("comId")Long comId);


    /**
     * 11.4.6点餐餐段查询（getOrderPlanMeal）
     */
    @PostMapping(PayConfigUrl.Url_getOrderPlanMeal)
    public Result<List<OrderPlanMealVo>> getOrderPlanMeal(@RequestBody GetOrderPlanMealRequest request) ;


    @PostMapping(PayConfigUrl.Url_dishesClassList)
    public Result dishesClassList(@RequestParam("comId")Long comId,@RequestParam("merchId")Integer merchId);


    /**
     * 11.4.8已点餐菜品查看（单个订单）（getOrderDishesDetail）
     */
    @PostMapping(PayConfigUrl.Url_getOrderDishesDetail)
    public Result getOrderDishesDetail(@RequestBody OrderedShowRequest request) ;


    //2.1.获取餐段名称信息(getMealNameInfo)
    @GetMapping(PayConfigUrl.URLP_PayConfig_GetMealNameInfo)
    Result getMealNameInfo(@RequestParam("comId") Long comId,@RequestParam("mealNo") String mealNo);


    @PostMapping(PayConfigUrl.Url_getDishesInfoDetailList)
    public Result findByComIdAndDishesId(@RequestBody GetDishesInfoDetailListRequest request);

    @PostMapping(PayConfigUrl.URL_feeDataByPerson)
    Result feeDataByPerson(@RequestBody FeeDataListVo feeItem);
    @PostMapping(PayConfigUrl.URL_getFeePayWay)
    Result feeItemListByWay(@RequestBody FeeItemListVo request);

    @PostMapping(PayConfigUrl.URL_findByFeeDataId)
    public Result findByFeeDataId(@RequestParam("comId") Long comId, @RequestParam("dataId") Integer dataId);

    @PostMapping(PayConfigUrl.Url_planKitchenPrinter)
    public Result planKitchenPrinter(@RequestBody PlanKitchenPrinterRequest request);


    @PostMapping(PayConfigUrl.Url_querySubAccount)
    public Result querySubAccount(@RequestBody QuerySubAccountRequest request);

    @PostMapping(PayConfigUrl.Url_getPackagePay)
    public Result getPackagePay(@RequestBody GetPackagePayRequest request);

    @PostMapping(PayConfigUrl.Url_getPackagePayDetail)
    public Result getPackagePayDetail(@RequestBody GetPackagePayDetailRequest request);

    @PostMapping(PayConfigUrl.Url_getCallPackageConfig)
    public Result getCallPackageConfig(@RequestBody OnShowRequest request);

    @PostMapping(PayConfigUrl.Url_addPackagePay)
    public Result addPackagePay(@RequestBody AddPackagePayRequest request);

    @PostMapping(PayConfigUrl.Url_GetCardInfoByCardNo)
    public Result getCardInfoByCardNo(@RequestParam("comId")Long comId, @RequestParam("cardNo")String cardNo);

    @GetMapping(PayConfigUrl.Url_GetCardInfoByPid)
    public Result GetCardInfoByPid(@RequestParam("comId")Long comId,@RequestParam("pId") Long pId);

    @PostMapping(PayConfigUrl.Url_UpdatecardState)
    public Result UpdatecardState(@RequestBody UpdatecardStateVo updatecardStateVo);

    @PostMapping(PayConfigUrl.Url_getRepairPayRecordList)
    public Result<Map<Object, Object>> getRepairPayRecordList(@RequestBody GetRepairPayRecordListRequest request);

    @PostMapping(PayConfigUrl.Url_RepairpayUpdatePayState)
    public Result updatePayState(@RequestBody EntityXfRecordWaitpay request);

    //获取账号信息(getXFAccount)
    @GetMapping(PayConfigUrl.Url_GetXFAccount)
    public Result<EntityXfAccountInfo> GetXFAccount(@RequestParam("comId")Long comId,@RequestParam("pId")Integer pId, @RequestParam("accountState")Integer accountState);

    // 修改账号信息(updateXFAccount)
    @PostMapping(PayConfigUrl.Url_UpdateXFAccount)
    public Result UpdateXFAccount(@RequestBody EntityXfAccountInfo entityXfAccountInfo);


    @PostMapping(PayConfigUrl.Url_refundOrderDishes)
    public Result refundOrderDishes(@RequestBody RefundOrderDishesRequest request);

    @PostMapping(PayConfigUrl.Url_getSchoolWifiList)
    public Result getSchoolWifiList(@RequestBody SchoolWifiInfoVo schoolWifiInfoVo);

    @PostMapping(PayConfigUrl.Url_updateSchoolWifiInfo)
    public Result updateSchoolWifiInfo(@RequestBody SchoolWifiInfoVo schoolWifiInfoVo);

    @PostMapping(PayConfigUrl.Url_getCloudComputingList)
    public Result getCloudComputingList(@RequestBody CloudComputingVo cloudComputingVo);

    @PostMapping(PayConfigUrl.Url_getSchoolPhoneList)
    public Result getSchoolPhoneList(@RequestBody SchoolPhoneInfoVo schoolPhoneInfoVo);

    @PostMapping(PayConfigUrl.Url_getSubAccountList)
    public Result getSubAccountList(@RequestParam(value = "comId") Integer comId);

    //2.2.获取餐段时间信息(getMealTimeInfo)
    @PostMapping(PayConfigUrl.URLP_PayConfig_GetMealTimeInfo)
    Result GetMealTimeInfo(@RequestBody ConsTimeConfigOnShowRequest request);

    /**
     * 2.37.获取消费限制参数（getConsumeLimitConfig）
     */
    @PostMapping(PayConfigUrl.Url_GetConsumeLimitConfig)
    public Result getConsumeLimitConfig(@RequestBody ConsumeLimitConfigOnShowRequest request);

    /**
     * @param entityOrderEvaluate
     * @return 6.11订餐点餐评价（/orderEvaluate）
     */
    @PostMapping(PayConfigUrl.Url_evaluateAdd)
    public Result orderEvaluate(@RequestBody EntityOrderEvaluate entityOrderEvaluate);



    @PostMapping(PayConfigUrl.URL_setOrderMealLeave)
    Result setOrderMealLeaveRequest(@RequestBody EntityXfMealLeave xfMealLeave);


    @PostMapping(PayConfigUrl.URL_getOrderMealLeave)
    Result getOrderMealLeave(@RequestBody GetOrderMealLeaveRequest getOrderMealLeaveRequest);


    @PostMapping(PayConfigUrl.Url_gzhRefunding)
    public Result<PageListResult<EntityXfRecordProcess>>  gzhRefunding(@RequestBody GzhRefundQueryRequest request);


    @PostMapping(PayConfigUrl.Url_getConsZoneList)
    public Result<List<EntityXfTimeZone>> getConsZoneList(@RequestParam("comId") Long comId);

    @GetMapping(PayConfigUrl.Url_GetXFAccountTypeDetails)
    public Result<EntityXfAccountType> GetXFAccountTypeDetails(@RequestParam("comId")Long comId,@RequestParam("accTypeId")Integer accTypeId);

    @GetMapping(PayConfigUrl.Url_GetXFAccountType)
    public Result<List<EntityXfAccountType>> GetXFAccountType(@RequestParam("comId") Long comId ,@RequestParam("grouping") Integer grouping);

    @PostMapping(PayConfigUrl.URL_addDishesToCart)
    public Result addDishesToCart(@RequestBody EntityXfShoppingCart xfShoppingCart);

    @PostMapping(PayConfigUrl.URL_removeDishesToCart)
    public Result removeDishesToCart(@RequestBody RemoveDishesToCartRequest request);

    @PostMapping(PayConfigUrl.URL_getDishesFormCart)
    public Result<List<GetDishesFormCartVo>> getDishesFormCart(@RequestBody GetDishesFormCartRequest request);

    @PostMapping(PayConfigUrl.Url_getReceiptAddressPriceList)
    public Result<List<EntityReceiptAddressPrice>> getReceiptAddressPriceList(@RequestBody EntityReceiptAddressPrice addressPrice);


    //添加协议签名信息
    @PostMapping(PayConfigUrl.Url_addSignRecords)
    public Result addSignRecords(@RequestBody EntitySignatureRecord signatureRecord);


    //取消协议
    @PostMapping(PayConfigUrl.Url_revokedSignRecords)
    public Result revokedSignRecords(@RequestBody SignatureUpdateRequest request);


    //获取列表
    @PostMapping(PayConfigUrl.Url_gzhSignRecords)
    public Result<PageVO<EntitySignatureRecord>> gzhSignRecords(@RequestBody SignatureListRequest request);

    @PostMapping(PayConfigUrl.Url_perDiscountLimit)
    public Result perDiscountLimit(@RequestBody PerDiscountLimitRequest request);

    //删除签约
    @PostMapping(PayConfigUrl.Url_delUserSign)
    public Result delUserSign(@RequestBody EntityXfSignNo entityXfSignNo) ;

    //最新一条签约
    @PostMapping(PayConfigUrl.Url_getUserSignInfo)
    public Result<EntityXfSignNo> getUserSignInfo(@RequestParam("comId")Long comId,
                                  @RequestParam("pId")Long pId,
                                  @RequestParam("merchId")Integer merchId,
                                  @RequestParam("payWay")Integer payWay,
                                  @RequestParam("status")Integer status);

    @PostMapping(PayConfigUrl.URL_getChangeDishesList)
    public Result getChangeDishesList(@RequestBody GetChangeDishesListRequest request);
}
